USE [Training]
GO
/****** Object:  StoredProcedure [dbo].[training_api_EmployeeInsert]    Script Date: 12/19/2012 21:56:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[training_api_EmployeeInsert]
	@FirstName			nvarchar(50),
	@LastName			nvarchar(50),
	@Email				nvarchar(100),
	@SmsNumber			nvarchar(11),
	@ReportsToID		int = null,
	@Password			nvarchar(200),
	@DepartmentTreeID	nvarchar(100) = null,
	@EmployeeID			int output
AS
	INSERT INTO Employee(
		FirstName,
		LastName,
		Email,
		SmsNumber,
		ReportsToID,
		Password,
		DepartmentTreeID,
		IsActive)
	VALUES(
		@FirstName,
		@LastName,
		@Email,
		@SmsNumber,
		@ReportsToID,
		@Password,
		@DepartmentTreeID,
		1)
		
	SELECT @EmployeeID = SCOPE_IDENTITY()